import { defineStore } from "pinia";
import { ref } from "vue";

//token仓库
const useTokenStore = defineStore("token", () => {
    const token = ref("")

    //设置token
    function setToken(newToken) {
        token.value = newToken
    }
    //删除token
    function removeToken() {
        token.value = ""
    }

    return{token,setToken,removeToken}

},{persist:true})
//开启此仓库持久化

export default useTokenStore
